import React, { Component } from 'react'
import {HashRouter as Router,Route} from "react-router-dom"
// import {HashRouter as Router,Route,Switch,Redirect} from "react-router-dom"
import Cart from "./components.js/cart/Cart"
import Index from "./components.js/index/Index"
import My from "./components.js/my/My"
import Categort from "./components.js/categort/Categort"
import Tabber from "./components.js/tabbar/Tabber"
import SearchCenter from "./components.js/searchCenter/SearchCenter"
import GoodDetail from "./components.js/goodDetail/GoodDetail"
import GoodList from "./components.js/goodlist/GoodList"
export default class configroter extends Component {
    render() {
        return (
            <div>
                <Router>
                    {/* 
                        props展开
                        {histotry location match}
                    */}
                    <Route path="/" exact render={ (props)=><Tabber><Index {...props}></Index></Tabber> }></Route>
                    <Route path="/cart" exact render={ ()=><Tabber><Cart></Cart></Tabber>}></Route>
                    <Route path="/my" exact render={ ()=><Tabber><My></My> </Tabber>}></Route>
                    <Route path="/Categort" exact render={ (props)=><Tabber><Categort {...props}></Categort></Tabber> }></Route>
                    <Route path="/SearchCenter" exact render={ ()=><SearchCenter></SearchCenter>}></Route>
                    <Route path="/goodDetail/:goods_id" exact render={ (props)=><GoodDetail {...props}></GoodDetail>}></Route>
                    <Route path="/GoodList/:query" exact render={ (props)=><GoodList {...props}></GoodList>}></Route>
                
                </Router>
                
            </div>
        )
    }
}
